package com.example.lib_repair

import android.view.View
import android.widget.CheckBox
import androidx.transition.Visibility
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class RepairAdapter : BaseQuickAdapter<RepairEntity,BaseViewHolder>(R.layout.item_repair){
    init {
        addChildClickViewIds(R.id.item_manage)
    }
    override fun convert(holder: BaseViewHolder, item: RepairEntity) {
        holder.setText(R.id.item_repair_title,item.repairDescribe)
        holder.setText(R.id.item_repair_place,item.repairData)
        if (item.isFlag==true){
            holder.getView<CheckBox>(R.id.item_repair).isChecked=true
        }else{
            holder.getView<CheckBox>(R.id.item_repair).isChecked=false
        }
        if (item.isSee==true){
            holder.getView<CheckBox>(R.id.item_repair).visibility=View.VISIBLE
        }else{
            holder.getView<CheckBox>(R.id.item_repair).visibility=View.GONE
        }
    }
}